<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script type="text/javascript" src="../js/vue.js"></script>
</head>

<body>
    <div id="app">
        <input type="text" v-model="firstNname">
        <input type="text" v-model="endNname">
        <button @click="pinjie()">点击</button>
        <p>{{aaa}}</p>
        <p>{{quan}}</p>
        <h2>今天天气很{{info}}</h2>
        <button @click="changeWeather">切换天气</button>

    </div>
    <script>
        new Vue({
            el: "#app",
            data() {
                return {
                    isHot: true,
                    firstNname: "刘",
                    endNname: "三",
                    quan: ""
                }
            },
            methods: {
                pinjie() {
                    this.quan = this.firstNname + this.endNname
                },
                changeWeather() {
                    this.isHot = !this.isHot
                }


            },
            computed: {
                //里面存放函数  必须有返回值
                aaa() {
                    re = this.firstNname + this.endNname
                    return re

                },
                info() {
                    return this.isHot ? '炎热' : '凉爽'

                }

            },
            watch: {
                isHot(newval, oldval) {
                    console.log();

                }

            }

        })



    </script>
</body>

</html>